/*
 * Copyright (C) 2017 XRADIO TECHNOLOGY CO., LTD. All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions
 *  are met:
 *    1. Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *    2. Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the
 *       distribution.
 *    3. Neither the name of XRADIO TECHNOLOGY CO., LTD. nor the names of
 *       its contributors may be used to endorse or promote products derived
 *       from this software without specific prior written permission.
 *
 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#include "fft.h"

// 1024 points FFT Twiddle factor Wn, HEX format;
// Re=int32(cos(2*pi*(0:511)/1024) * (2^31-1))';	//Coefficient expansion
// Im=int32(sin(2*pi*(0:511)/1024) * (2^31-1))';		//Coefficient expansion
const COMPLEX WN[512] =
{
{0x7FFFFFFF,0x00000000},
{0x7FFF6215,0xFF36F078},
{0x7FFD8859,0xFE6DE2E0},
{0x7FFA72D0,0xFDA4D929},
{0x7FF62181,0xFCDBD541},
{0x7FF09477,0xFC12D91A},
{0x7FE9CBBF,0xFB49E6A3},
{0x7FE1C76A,0xFA80FFCB},
{0x7FD8878D,0xF9B82684},
{0x7FCE0C3D,0xF8EF5CBB},
{0x7FC25595,0xF826A462},
{0x7FB563B2,0xF75DFF66},
{0x7FA736B3,0xF6956FB7},
{0x7F97CEBC,0xF5CCF744},
{0x7F872BF2,0xF50497FB},
{0x7F754E7F,0xF43C53CB},
{0x7F62368E,0xF3742CA2},
{0x7F4DE450,0xF2AC246E},
{0x7F3857F5,0xF1E43D1C},
{0x7F2191B3,0xF11C789A},
{0x7F0991C3,0xF054D8D5},
{0x7EF0585F,0xEF8D5FB8},
{0x7ED5E5C5,0xEEC60F31},
{0x7EBA3A38,0xEDFEE92B},
{0x7E9D55FB,0xED37EF92},
{0x7E7F3956,0xEC71244F},
{0x7E5FE492,0xEBAA894F},
{0x7E3F57FE,0xEAE4207B},
{0x7E1D93E9,0xEA1DEBBC},
{0x7DFA98A7,0xE957ECFB},
{0x7DD6668E,0xE8922622},
{0x7DB0FDF7,0xE7CC9918},
{0x7D8A5F3F,0xE70747C4},
{0x7D628AC5,0xE642340D},
{0x7D3980EB,0xE57D5FDB},
{0x7D0F4217,0xE4B8CD11},
{0x7CE3CEB1,0xE3F47D96},
{0x7CB72723,0xE330734D},
{0x7C894BDD,0xE26CB01B},
{0x7C5A3D4F,0xE1A935E2},
{0x7C29FBED,0xE0E60685},
{0x7BF8882F,0xE02323E5},
{0x7BC5E28F,0xDF608FE4},
{0x7B920B88,0xDE9E4C61},
{0x7B5D039D,0xDDDC5B3B},
{0x7B26CB4E,0xDD1ABE51},
{0x7AEF6323,0xDC597782},
{0x7AB6CBA3,0xDB9888A9},
{0x7A7D055A,0xDAD7F3A3},
{0x7A4210D8,0xDA17BA4A},
{0x7A05EEAC,0xD957DE7B},
{0x79C89F6D,0xD898620C},
{0x798A23B0,0xD7D946D8},
{0x794A7C11,0xD71A8EB6},
{0x7909A92C,0xD65C3B7B},
{0x78C7ABA1,0xD59E4EFF},
{0x78848413,0xD4E0CB15},
{0x78403328,0xD423B191},
{0x77FAB988,0xD3670446},
{0x77B417DF,0xD2AAC505},
{0x776C4EDA,0xD1EEF59E},
{0x77235F2C,0xD13397E2},
{0x76D94988,0xD078AD9E},
{0x768E0EA5,0xCFBE38A0},
{0x7641AF3C,0xCF043AB3},
{0x75F42C0A,0xCE4AB5A3},
{0x75A585CE,0xCD91AB39},
{0x7555BD4B,0xCCD91D3E},
{0x7504D344,0xCC210D79},
{0x74B2C883,0xCB697DB1},
{0x745F9DD0,0xCAB26FAA},
{0x740B53FA,0xC9FBE527},
{0x73B5EBD0,0xC945DFED},
{0x735F6625,0xC89061BA},
{0x7307C3CF,0xC7DB6C50},
{0x72AF05A6,0xC727016D},
{0x72552C84,0xC67322CE},
{0x71FA3948,0xC5BFD22F},
{0x719E2CD1,0xC50D1149},
{0x71410804,0xC45AE1D7},
{0x70E2CBC5,0xC3A94590},
{0x708378FE,0xC2F83E2B},
{0x70231099,0xC247CD5B},
{0x6FC19384,0xC197F4D4},
{0x6F5F02B1,0xC0E8B649},
{0x6EFB5F11,0xC03A1369},
{0x6E96A99C,0xBF8C0DE3},
{0x6E30E349,0xBEDEA766},
{0x6DCA0D14,0xBE31E19C},
{0x6D6227F9,0xBD85BE30},
{0x6CF934FB,0xBCDA3ECB},
{0x6C8F351B,0xBC2F6514},
{0x6C24295F,0xBB8532B0},
{0x6BB812D0,0xBADBA944},
{0x6B4AF278,0xBA32CA71},
{0x6ADCC964,0xB98A97D9},
{0x6A6D98A3,0xB8E3131A},
{0x69FD614A,0xB83C3DD2},
{0x698C246B,0xB796199C},
{0x6919E31F,0xB6F0A812},
{0x68A69E80,0xB64BEACD},
{0x683257AA,0xB5A7E363},
{0x67BD0FBC,0xB5049369},
{0x6746C7D7,0xB461FC71},
{0x66CF811F,0xB3C0200D},
{0x66573CBB,0xB31EFFCC},
{0x65DDFBD2,0xB27E9D3D},
{0x6563BF91,0xB1DEF9E9},
{0x64E88925,0xB140175C},
{0x646C59BF,0xB0A1F71E},
{0x63EF328F,0xB0049AB4},
{0x637114CC,0xAF6803A2},
{0x62F201AC,0xAECC336C},
{0x6271FA68,0xAE312B92},
{0x61F1003E,0xAD96ED92},
{0x616F146B,0xACFD7AE9},
{0x60EC382F,0xAC64D511},
{0x60686CCE,0xABCCFD83},
{0x5FE3B38D,0xAB35F5B6},
{0x5F5E0DB2,0xAA9FBF1E},
{0x5ED77C89,0xAA0A5B2E},
{0x5E50015D,0xA975CB57},
{0x5DC79D7B,0xA8E21107},
{0x5D3E5236,0xA84F2DAB},
{0x5CB420DF,0xA7BD22AC},
{0x5C290ACC,0xA72BF174},
{0x5B9D1153,0xA69B9B69},
{0x5B1035CE,0xA60C21EE},
{0x5A827999,0xA57D8667},
{0x59F3DE12,0xA4EFCA32},
{0x59646497,0xA462EEAD},
{0x58D40E8C,0xA3D6F534},
{0x5842DD54,0xA34BDF21},
{0x57B0D255,0xA2C1ADCA},
{0x571DEEF9,0xA2386285},
{0x568A34A9,0xA1AFFEA3},
{0x55F5A4D2,0xA1288377},
{0x556040E2,0xA0A1F24E},
{0x54CA0A4A,0xA01C4C73},
{0x5433027D,0x9F979332},
{0x539B2AEF,0x9F13C7D1},
{0x53028517,0x9E90EB95},
{0x5269126E,0x9E0EFFC2},
{0x51CED46E,0x9D8E0598},
{0x5133CC94,0x9D0DFE54},
{0x5097FC5E,0x9C8EEB34},
{0x4FFB654C,0x9C10CD71},
{0x4F5E08E2,0x9B93A641},
{0x4EBFE8A4,0x9B1776DB},
{0x4E210617,0x9A9C406F},
{0x4D8162C3,0x9A22042E},
{0x4CE10034,0x99A8C345},
{0x4C3FDFF3,0x99307EE1},
{0x4B9E038F,0x98B93829},
{0x4AFB6C97,0x9842F044},
{0x4A581C9D,0x97CDA856},
{0x49B41533,0x97596180},
{0x490F57EE,0x96E61CE1},
{0x4869E664,0x9673DB95},
{0x47C3C22E,0x96029EB6},
{0x471CECE6,0x9592675D},
{0x46756827,0x9523369C},
{0x45CD358F,0x94B50D88},
{0x452456BC,0x9447ED30},
{0x447ACD50,0x93DBD6A1},
{0x43D09AEC,0x9370CAE5},
{0x4325C135,0x9306CB05},
{0x427A41D0,0x929DD807},
{0x41CE1E64,0x9235F2EC},
{0x4121589A,0x91CF1CB7},
{0x4073F21D,0x91695664},
{0x3FC5EC97,0x9104A0EF},
{0x3F1749B7,0x90A0FD4F},
{0x3E680B2C,0x903E6C7C},
{0x3DB832A5,0x8FDCEF67},
{0x3D07C1D5,0x8F7C8702},
{0x3C56BA70,0x8F1D343B},
{0x3BA51E29,0x8EBEF7FC},
{0x3AF2EEB7,0x8E61D32F},
{0x3A402DD1,0x8E05C6B8},
{0x398CDD32,0x8DAAD37C},
{0x38D8FE93,0x8D50FA5A},
{0x382493B0,0x8CF83C31},
{0x376F9E46,0x8CA099DB},
{0x36BA2013,0x8C4A1430},
{0x36041AD9,0x8BF4AC06},
{0x354D9056,0x8BA06230},
{0x3496824F,0x8B4D377D},
{0x33DEF287,0x8AFB2CBC},
{0x3326E2C2,0x8AAA42B5},
{0x326E54C7,0x8A5A7A32},
{0x31B54A5D,0x8A0BD3F6},
{0x30FBC54D,0x89BE50C4},
{0x3041C760,0x8971F15B},
{0x2F875262,0x8926B678},
{0x2ECC681E,0x88DCA0D4},
{0x2E110A62,0x8893B126},
{0x2D553AFB,0x884BE821},
{0x2C98FBBA,0x88054678},
{0x2BDC4E6F,0x87BFCCD8},
{0x2B1F34EB,0x877B7BED},
{0x2A61B101,0x8738545F},
{0x29A3C485,0x86F656D4},
{0x28E5714A,0x86B583EF},
{0x2826B928,0x8675DC50},
{0x27679DF4,0x86376093},
{0x26A82185,0x85FA1154},
{0x25E845B6,0x85BDEF28},
{0x25280C5D,0x8582FAA6},
{0x24677757,0x8549345D},
{0x23A6887E,0x85109CDD},
{0x22E541AF,0x84D934B2},
{0x2223A4C5,0x84A2FC63},
{0x2161B39F,0x846DF478},
{0x209F701C,0x843A1D71},
{0x1FDCDC1B,0x840777D1},
{0x1F19F97B,0x83D60413},
{0x1E56CA1E,0x83A5C2B1},
{0x1D934FE5,0x8376B423},
{0x1CCF8CB3,0x8348D8DD},
{0x1C0B826A,0x831C314F},
{0x1B4732EF,0x82F0BDE9},
{0x1A82A025,0x82C67F15},
{0x19BDCBF3,0x829D753B},
{0x18F8B83C,0x8275A0C1},
{0x183366E8,0x824F0209},
{0x176DD9DE,0x82299972},
{0x16A81305,0x82056759},
{0x15E21444,0x81E26C17},
{0x151BDF85,0x81C0A802},
{0x145576B1,0x81A01B6E},
{0x138EDBB1,0x8180C6AA},
{0x12C8106E,0x8162AA05},
{0x120116D5,0x8145C5C8},
{0x1139F0CF,0x812A1A3B},
{0x1072A048,0x810FA7A1},
{0x0FAB272B,0x80F66E3D},
{0x0EE38766,0x80DE6E4D},
{0x0E1BC2E4,0x80C7A80B},
{0x0D53DB92,0x80B21BB0},
{0x0C8BD35E,0x809DC972},
{0x0BC3AC35,0x808AB181},
{0x0AFB6805,0x8078D40E},
{0x0A3308BC,0x80683144},
{0x096A9049,0x8058C94D},
{0x08A2009A,0x804A9C4E},
{0x07D95B9E,0x803DAA6B},
{0x0710A345,0x8031F3C3},
{0x0647D97C,0x80277873},
{0x057F0035,0x801E3896},
{0x04B6195D,0x80163441},
{0x03ED26E6,0x800F6B89},
{0x03242ABF,0x8009DE7F},
{0x025B26D7,0x80058D30},
{0x01921D20,0x800277A7},
{0x00C90F88,0x80009DEB},
{0x00000000,0x80000001},
{0xFF36F078,0x80009DEB},
{0xFE6DE2E0,0x800277A7},
{0xFDA4D929,0x80058D30},
{0xFCDBD541,0x8009DE7F},
{0xFC12D91A,0x800F6B89},
{0xFB49E6A3,0x80163441},
{0xFA80FFCB,0x801E3896},
{0xF9B82684,0x80277873},
{0xF8EF5CBB,0x8031F3C3},
{0xF826A462,0x803DAA6B},
{0xF75DFF66,0x804A9C4E},
{0xF6956FB7,0x8058C94D},
{0xF5CCF744,0x80683144},
{0xF50497FB,0x8078D40E},
{0xF43C53CB,0x808AB181},
{0xF3742CA2,0x809DC972},
{0xF2AC246E,0x80B21BB0},
{0xF1E43D1C,0x80C7A80B},
{0xF11C789A,0x80DE6E4D},
{0xF054D8D5,0x80F66E3D},
{0xEF8D5FB8,0x810FA7A1},
{0xEEC60F31,0x812A1A3B},
{0xEDFEE92B,0x8145C5C8},
{0xED37EF92,0x8162AA05},
{0xEC71244F,0x8180C6AA},
{0xEBAA894F,0x81A01B6E},
{0xEAE4207B,0x81C0A802},
{0xEA1DEBBC,0x81E26C17},
{0xE957ECFB,0x82056759},
{0xE8922622,0x82299972},
{0xE7CC9918,0x824F0209},
{0xE70747C4,0x8275A0C1},
{0xE642340D,0x829D753B},
{0xE57D5FDB,0x82C67F15},
{0xE4B8CD11,0x82F0BDE9},
{0xE3F47D96,0x831C314F},
{0xE330734D,0x8348D8DD},
{0xE26CB01B,0x8376B423},
{0xE1A935E2,0x83A5C2B1},
{0xE0E60685,0x83D60413},
{0xE02323E5,0x840777D1},
{0xDF608FE4,0x843A1D71},
{0xDE9E4C61,0x846DF478},
{0xDDDC5B3B,0x84A2FC63},
{0xDD1ABE51,0x84D934B2},
{0xDC597782,0x85109CDD},
{0xDB9888A9,0x8549345D},
{0xDAD7F3A3,0x8582FAA6},
{0xDA17BA4A,0x85BDEF28},
{0xD957DE7B,0x85FA1154},
{0xD898620C,0x86376093},
{0xD7D946D8,0x8675DC50},
{0xD71A8EB6,0x86B583EF},
{0xD65C3B7B,0x86F656D4},
{0xD59E4EFF,0x8738545F},
{0xD4E0CB15,0x877B7BED},
{0xD423B191,0x87BFCCD8},
{0xD3670446,0x88054678},
{0xD2AAC505,0x884BE821},
{0xD1EEF59E,0x8893B126},
{0xD13397E2,0x88DCA0D4},
{0xD078AD9E,0x8926B678},
{0xCFBE38A0,0x8971F15B},
{0xCF043AB3,0x89BE50C4},
{0xCE4AB5A3,0x8A0BD3F6},
{0xCD91AB39,0x8A5A7A32},
{0xCCD91D3E,0x8AAA42B5},
{0xCC210D79,0x8AFB2CBC},
{0xCB697DB1,0x8B4D377D},
{0xCAB26FAA,0x8BA06230},
{0xC9FBE527,0x8BF4AC06},
{0xC945DFED,0x8C4A1430},
{0xC89061BA,0x8CA099DB},
{0xC7DB6C50,0x8CF83C31},
{0xC727016D,0x8D50FA5A},
{0xC67322CE,0x8DAAD37C},
{0xC5BFD22F,0x8E05C6B8},
{0xC50D1149,0x8E61D32F},
{0xC45AE1D7,0x8EBEF7FC},
{0xC3A94590,0x8F1D343B},
{0xC2F83E2B,0x8F7C8702},
{0xC247CD5B,0x8FDCEF67},
{0xC197F4D4,0x903E6C7C},
{0xC0E8B649,0x90A0FD4F},
{0xC03A1369,0x9104A0EF},
{0xBF8C0DE3,0x91695664},
{0xBEDEA766,0x91CF1CB7},
{0xBE31E19C,0x9235F2EC},
{0xBD85BE30,0x929DD807},
{0xBCDA3ECB,0x9306CB05},
{0xBC2F6514,0x9370CAE5},
{0xBB8532B0,0x93DBD6A1},
{0xBADBA944,0x9447ED30},
{0xBA32CA71,0x94B50D88},
{0xB98A97D9,0x9523369C},
{0xB8E3131A,0x9592675D},
{0xB83C3DD2,0x96029EB6},
{0xB796199C,0x9673DB95},
{0xB6F0A812,0x96E61CE1},
{0xB64BEACD,0x97596180},
{0xB5A7E363,0x97CDA856},
{0xB5049369,0x9842F044},
{0xB461FC71,0x98B93829},
{0xB3C0200D,0x99307EE1},
{0xB31EFFCC,0x99A8C345},
{0xB27E9D3D,0x9A22042E},
{0xB1DEF9E9,0x9A9C406F},
{0xB140175C,0x9B1776DB},
{0xB0A1F71E,0x9B93A641},
{0xB0049AB4,0x9C10CD71},
{0xAF6803A2,0x9C8EEB34},
{0xAECC336C,0x9D0DFE54},
{0xAE312B92,0x9D8E0598},
{0xAD96ED92,0x9E0EFFC2},
{0xACFD7AE9,0x9E90EB95},
{0xAC64D511,0x9F13C7D1},
{0xABCCFD83,0x9F979332},
{0xAB35F5B6,0xA01C4C73},
{0xAA9FBF1E,0xA0A1F24E},
{0xAA0A5B2E,0xA1288377},
{0xA975CB57,0xA1AFFEA3},
{0xA8E21107,0xA2386285},
{0xA84F2DAB,0xA2C1ADCA},
{0xA7BD22AC,0xA34BDF21},
{0xA72BF174,0xA3D6F534},
{0xA69B9B69,0xA462EEAD},
{0xA60C21EE,0xA4EFCA32},
{0xA57D8667,0xA57D8667},
{0xA4EFCA32,0xA60C21EE},
{0xA462EEAD,0xA69B9B69},
{0xA3D6F534,0xA72BF174},
{0xA34BDF21,0xA7BD22AC},
{0xA2C1ADCA,0xA84F2DAB},
{0xA2386285,0xA8E21107},
{0xA1AFFEA3,0xA975CB57},
{0xA1288377,0xAA0A5B2E},
{0xA0A1F24E,0xAA9FBF1E},
{0xA01C4C73,0xAB35F5B6},
{0x9F979332,0xABCCFD83},
{0x9F13C7D1,0xAC64D511},
{0x9E90EB95,0xACFD7AE9},
{0x9E0EFFC2,0xAD96ED92},
{0x9D8E0598,0xAE312B92},
{0x9D0DFE54,0xAECC336C},
{0x9C8EEB34,0xAF6803A2},
{0x9C10CD71,0xB0049AB4},
{0x9B93A641,0xB0A1F71E},
{0x9B1776DB,0xB140175C},
{0x9A9C406F,0xB1DEF9E9},
{0x9A22042E,0xB27E9D3D},
{0x99A8C345,0xB31EFFCC},
{0x99307EE1,0xB3C0200D},
{0x98B93829,0xB461FC71},
{0x9842F044,0xB5049369},
{0x97CDA856,0xB5A7E363},
{0x97596180,0xB64BEACD},
{0x96E61CE1,0xB6F0A812},
{0x9673DB95,0xB796199C},
{0x96029EB6,0xB83C3DD2},
{0x9592675D,0xB8E3131A},
{0x9523369C,0xB98A97D9},
{0x94B50D88,0xBA32CA71},
{0x9447ED30,0xBADBA944},
{0x93DBD6A1,0xBB8532B0},
{0x9370CAE5,0xBC2F6514},
{0x9306CB05,0xBCDA3ECB},
{0x929DD807,0xBD85BE30},
{0x9235F2EC,0xBE31E19C},
{0x91CF1CB7,0xBEDEA766},
{0x91695664,0xBF8C0DE3},
{0x9104A0EF,0xC03A1369},
{0x90A0FD4F,0xC0E8B649},
{0x903E6C7C,0xC197F4D4},
{0x8FDCEF67,0xC247CD5B},
{0x8F7C8702,0xC2F83E2B},
{0x8F1D343B,0xC3A94590},
{0x8EBEF7FC,0xC45AE1D7},
{0x8E61D32F,0xC50D1149},
{0x8E05C6B8,0xC5BFD22F},
{0x8DAAD37C,0xC67322CE},
{0x8D50FA5A,0xC727016D},
{0x8CF83C31,0xC7DB6C50},
{0x8CA099DB,0xC89061BA},
{0x8C4A1430,0xC945DFED},
{0x8BF4AC06,0xC9FBE527},
{0x8BA06230,0xCAB26FAA},
{0x8B4D377D,0xCB697DB1},
{0x8AFB2CBC,0xCC210D79},
{0x8AAA42B5,0xCCD91D3E},
{0x8A5A7A32,0xCD91AB39},
{0x8A0BD3F6,0xCE4AB5A3},
{0x89BE50C4,0xCF043AB3},
{0x8971F15B,0xCFBE38A0},
{0x8926B678,0xD078AD9E},
{0x88DCA0D4,0xD13397E2},
{0x8893B126,0xD1EEF59E},
{0x884BE821,0xD2AAC505},
{0x88054678,0xD3670446},
{0x87BFCCD8,0xD423B191},
{0x877B7BED,0xD4E0CB15},
{0x8738545F,0xD59E4EFF},
{0x86F656D4,0xD65C3B7B},
{0x86B583EF,0xD71A8EB6},
{0x8675DC50,0xD7D946D8},
{0x86376093,0xD898620C},
{0x85FA1154,0xD957DE7B},
{0x85BDEF28,0xDA17BA4A},
{0x8582FAA6,0xDAD7F3A3},
{0x8549345D,0xDB9888A9},
{0x85109CDD,0xDC597782},
{0x84D934B2,0xDD1ABE51},
{0x84A2FC63,0xDDDC5B3B},
{0x846DF478,0xDE9E4C61},
{0x843A1D71,0xDF608FE4},
{0x840777D1,0xE02323E5},
{0x83D60413,0xE0E60685},
{0x83A5C2B1,0xE1A935E2},
{0x8376B423,0xE26CB01B},
{0x8348D8DD,0xE330734D},
{0x831C314F,0xE3F47D96},
{0x82F0BDE9,0xE4B8CD11},
{0x82C67F15,0xE57D5FDB},
{0x829D753B,0xE642340D},
{0x8275A0C1,0xE70747C4},
{0x824F0209,0xE7CC9918},
{0x82299972,0xE8922622},
{0x82056759,0xE957ECFB},
{0x81E26C17,0xEA1DEBBC},
{0x81C0A802,0xEAE4207B},
{0x81A01B6E,0xEBAA894F},
{0x8180C6AA,0xEC71244F},
{0x8162AA05,0xED37EF92},
{0x8145C5C8,0xEDFEE92B},
{0x812A1A3B,0xEEC60F31},
{0x810FA7A1,0xEF8D5FB8},
{0x80F66E3D,0xF054D8D5},
{0x80DE6E4D,0xF11C789A},
{0x80C7A80B,0xF1E43D1C},
{0x80B21BB0,0xF2AC246E},
{0x809DC972,0xF3742CA2},
{0x808AB181,0xF43C53CB},
{0x8078D40E,0xF50497FB},
{0x80683144,0xF5CCF744},
{0x8058C94D,0xF6956FB7},
{0x804A9C4E,0xF75DFF66},
{0x803DAA6B,0xF826A462},
{0x8031F3C3,0xF8EF5CBB},
{0x80277873,0xF9B82684},
{0x801E3896,0xFA80FFCB},
{0x80163441,0xFB49E6A3},
{0x800F6B89,0xFC12D91A},
{0x8009DE7F,0xFCDBD541},
{0x80058D30,0xFDA4D929},
{0x800277A7,0xFE6DE2E0},
{0x80009DEB,0xFF36F078}
};

//BhW  = blackmanharris(1024);			//1024 points Blackman-Harrris Window
//Bh = (2*BhW/sum(BhW)) * 2^31;		//Coefficient expansion
const __u32 Bh[1024] =
{
0x000002be,
0x000002c4,
0x000002d7,
0x000002f6,
0x00000322,
0x0000035a,
0x0000039f,
0x000003f1,
0x00000450,
0x000004bb,
0x00000534,
0x000005ba,
0x0000064d,
0x000006ed,
0x0000079c,
0x00000858,
0x00000922,
0x000009fa,
0x00000ae1,
0x00000bd7,
0x00000cdb,
0x00000def,
0x00000f12,
0x00001045,
0x00001189,
0x000012dc,
0x00001441,
0x000015b7,
0x0000173e,
0x000018d7,
0x00001a82,
0x00001c40,
0x00001e11,
0x00001ff6,
0x000021ee,
0x000023fb,
0x0000261d,
0x00002855,
0x00002aa2,
0x00002d06,
0x00002f80,
0x00003212,
0x000034bc,
0x0000377f,
0x00003a5b,
0x00003d51,
0x00004061,
0x0000438c,
0x000046d3,
0x00004a36,
0x00004db6,
0x00005154,
0x00005510,
0x000058ec,
0x00005ce7,
0x00006102,
0x0000653f,
0x0000699e,
0x00006e1f,
0x000072c4,
0x0000778e,
0x00007c7c,
0x00008191,
0x000086cd,
0x00008c30,
0x000091bc,
0x00009771,
0x00009d50,
0x0000a35b,
0x0000a992,
0x0000aff6,
0x0000b688,
0x0000bd49,
0x0000c43a,
0x0000cb5c,
0x0000d2b0,
0x0000da36,
0x0000e1f1,
0x0000e9e1,
0x0000f206,
0x0000fa63,
0x000102f8,
0x00010bc6,
0x000114ce,
0x00011e12,
0x00012792,
0x00013150,
0x00013b4d,
0x0001458a,
0x00015008,
0x00015ac8,
0x000165cc,
0x00017114,
0x00017ca2,
0x00018877,
0x00019495,
0x0001a0fc,
0x0001adae,
0x0001baac,
0x0001c7f8,
0x0001d592,
0x0001e37c,
0x0001f1b7,
0x00020045,
0x00020f27,
0x00021e5e,
0x00022deb,
0x00023dd1,
0x00024e10,
0x00025ea9,
0x00026f9f,
0x000280f2,
0x000292a3,
0x0002a4b5,
0x0002b729,
0x0002ca00,
0x0002dd3b,
0x0002f0dc,
0x000304e5,
0x00031956,
0x00032e32,
0x0003437a,
0x0003592e,
0x00036f52,
0x000385e6,
0x00039cec,
0x0003b465,
0x0003cc52,
0x0003e4b6,
0x0003fd92,
0x000416e7,
0x000430b7,
0x00044b03,
0x000465cd,
0x00048117,
0x00049ce2,
0x0004b92f,
0x0004d601,
0x0004f358,
0x00051137,
0x00052f9e,
0x00054e90,
0x00056e0e,
0x00058e19,
0x0005aeb4,
0x0005cfdf,
0x0005f19c,
0x000613ee,
0x000636d5,
0x00065a53,
0x00067e69,
0x0006a31a,
0x0006c866,
0x0006ee50,
0x000714d9,
0x00073c03,
0x000763ce,
0x00078c3d,
0x0007b552,
0x0007df0d,
0x00080971,
0x0008347e,
0x00086037,
0x00088c9e,
0x0008b9b3,
0x0008e778,
0x000915ee,
0x00094518,
0x000974f7,
0x0009a58d,
0x0009d6da,
0x000a08e0,
0x000a3ba1,
0x000a6f1f,
0x000aa35a,
0x000ad855,
0x000b0e11,
0x000b448f,
0x000b7bd1,
0x000bb3d7,
0x000beca5,
0x000c263b,
0x000c609a,
0x000c9bc4,
0x000cd7ba,
0x000d147e,
0x000d5211,
0x000d9074,
0x000dcfa9,
0x000e0fb1,
0x000e508e,
0x000e9240,
0x000ed4c9,
0x000f182b,
0x000f5c66,
0x000fa17c,
0x000fe76e,
0x00102e3d,
0x001075ea,
0x0010be77,
0x001107e5,
0x00115234,
0x00119d67,
0x0011e97e,
0x0012367a,
0x0012845c,
0x0012d326,
0x001322d8,
0x00137373,
0x0013c4f9,
0x0014176a,
0x00146ac7,
0x0014bf11,
0x00151449,
0x00156a71,
0x0015c188,
0x00161990,
0x00167289,
0x0016cc74,
0x00172752,
0x00178324,
0x0017dfea,
0x00183da5,
0x00189c56,
0x0018fbfe,
0x00195c9c,
0x0019be31,
0x001a20bf,
0x001a8445,
0x001ae8c4,
0x001b4e3c,
0x001bb4af,
0x001c1c1b,
0x001c8482,
0x001cede4,
0x001d5842,
0x001dc39b,
0x001e2fef,
0x001e9d40,
0x001f0b8c,
0x001f7ad5,
0x001feb1b,
0x00205c5c,
0x0020ce9a,
0x002141d5,
0x0021b60c,
0x00222b40,
0x0022a170,
0x0023189c,
0x002390c4,
0x002409e8,
0x00248407,
0x0024ff22,
0x00257b37,
0x0025f847,
0x00267652,
0x0026f556,
0x00277554,
0x0027f64b,
0x00287839,
0x0028fb20,
0x00297efe,
0x002a03d2,
0x002a899c,
0x002b105b,
0x002b980f,
0x002c20b6,
0x002caa50,
0x002d34db,
0x002dc057,
0x002e4cc3,
0x002eda1e,
0x002f6867,
0x002ff79d,
0x003087be,
0x003118c9,
0x0031aabe,
0x00323d9b,
0x0032d15f,
0x00336607,
0x0033fb94,
0x00349204,
0x00352954,
0x0035c184,
0x00365a92,
0x0036f47d,
0x00378f42,
0x00382ae1,
0x0038c757,
0x003964a3,
0x003a02c3,
0x003aa1b4,
0x003b4176,
0x003be207,
0x003c8363,
0x003d258a,
0x003dc87a,
0x003e6c2f,
0x003f10a9,
0x003fb5e4,
0x00405bdf,
0x00410298,
0x0041aa0c,
0x00425238,
0x0042fb1b,
0x0043a4b2,
0x00444efb,
0x0044f9f2,
0x0045a596,
0x004651e5,
0x0046feda,
0x0047ac74,
0x00485ab0,
0x0049098b,
0x0049b902,
0x004a6913,
0x004b19bb,
0x004bcaf7,
0x004c7cc3,
0x004d2f1e,
0x004de203,
0x004e9570,
0x004f4962,
0x004ffdd6,
0x0050b2c8,
0x00516835,
0x00521e1a,
0x0052d474,
0x00538b3f,
0x00544278,
0x0054fa1c,
0x0055b227,
0x00566a96,
0x00572365,
0x0057dc91,
0x00589617,
0x00594ff1,
0x005a0a1e,
0x005ac499,
0x005b7f5f,
0x005c3a6b,
0x005cf5bb,
0x005db14a,
0x005e6d15,
0x005f2917,
0x005fe54d,
0x0060a1b4,
0x00615e46,
0x00621b00,
0x0062d7de,
0x006394dc,
0x006451f6,
0x00650f28,
0x0065cc6e,
0x006689c4,
0x00674725,
0x0068048d,
0x0068c1f9,
0x00697f64,
0x006a3cc9,
0x006afa25,
0x006bb773,
0x006c74af,
0x006d31d5,
0x006deee0,
0x006eabcb,
0x006f6893,
0x00702534,
0x0070e1a7,
0x00719deb,
0x007259f9,
0x007315cd,
0x0073d163,
0x00748cb7,
0x007547c3,
0x00760284,
0x0076bcf4,
0x00777710,
0x007830d3,
0x0078ea38,
0x0079a33a,
0x007a5bd6,
0x007b1406,
0x007bcbc6,
0x007c8311,
0x007d39e2,
0x007df036,
0x007ea608,
0x007f5b52,
0x00801010,
0x0080c43e,
0x008177d6,
0x00822ad6,
0x0082dd36,
0x00838ef4,
0x0084400a,
0x0084f075,
0x0085a02e,
0x00864f32,
0x0086fd7c,
0x0087ab07,
0x008857cf,
0x008903cf,
0x0089af03,
0x008a5966,
0x008b02f3,
0x008baba7,
0x008c537b,
0x008cfa6d,
0x008da076,
0x008e4593,
0x008ee9c0,
0x008f8cf7,
0x00902f35,
0x0090d075,
0x009170b1,
0x00920fe7,
0x0092ae12,
0x00934b2c,
0x0093e733,
0x00948220,
0x00951bf1,
0x0095b4a1,
0x00964c2b,
0x0096e28c,
0x009777be,
0x00980bbf,
0x00989e89,
0x00993018,
0x0099c069,
0x009a4f77,
0x009add3e,
0x009b69ba,
0x009bf4e7,
0x009c7ec2,
0x009d0745,
0x009d8e6d,
0x009e1437,
0x009e989e,
0x009f1b9f,
0x009f9d35,
0x00a01d5e,
0x00a09c14,
0x00a11955,
0x00a1951d,
0x00a20f69,
0x00a28834,
0x00a2ff7b,
0x00a3753a,
0x00a3e96f,
0x00a45c16,
0x00a4cd2b,
0x00a53cab,
0x00a5aa93,
0x00a616df,
0x00a6818c,
0x00a6ea98,
0x00a751fe,
0x00a7b7bc,
0x00a81bd0,
0x00a87e35,
0x00a8dee8,
0x00a93de8,
0x00a99b31,
0x00a9f6c1,
0x00aa5094,
0x00aaa8a7,
0x00aafef9,
0x00ab5387,
0x00aba64e,
0x00abf74c,
0x00ac467d,
0x00ac93e1,
0x00acdf73,
0x00ad2933,
0x00ad711e,
0x00adb732,
0x00adfb6c,
0x00ae3dca,
0x00ae7e4b,
0x00aebced,
0x00aef9ad,
0x00af348a,
0x00af6d82,
0x00afa493,
0x00afd9bc,
0x00b00cfb,
0x00b03e4e,
0x00b06db3,
0x00b09b2b,
0x00b0c6b2,
0x00b0f048,
0x00b117eb,
0x00b13d9b,
0x00b16155,
0x00b1831a,
0x00b1a2e7,
0x00b1c0bc,
0x00b1dc99,
0x00b1f67b,
0x00b20e63,
0x00b2244f,
0x00b2383f,
0x00b24a33,
0x00b25a29,
0x00b26822,
0x00b2741c,
0x00b27e18,
0x00b28616,
0x00b28c14,
0x00b29013,
0x00b29212,
0x00b29212,
0x00b29013,
0x00b28c14,
0x00b28616,
0x00b27e18,
0x00b2741c,
0x00b26822,
0x00b25a29,
0x00b24a33,
0x00b2383f,
0x00b2244f,
0x00b20e63,
0x00b1f67b,
0x00b1dc99,
0x00b1c0bc,
0x00b1a2e7,
0x00b1831a,
0x00b16155,
0x00b13d9b,
0x00b117eb,
0x00b0f048,
0x00b0c6b2,
0x00b09b2b,
0x00b06db3,
0x00b03e4e,
0x00b00cfb,
0x00afd9bc,
0x00afa493,
0x00af6d82,
0x00af348a,
0x00aef9ad,
0x00aebced,
0x00ae7e4b,
0x00ae3dca,
0x00adfb6c,
0x00adb732,
0x00ad711e,
0x00ad2933,
0x00acdf73,
0x00ac93e1,
0x00ac467d,
0x00abf74c,
0x00aba64e,
0x00ab5387,
0x00aafef9,
0x00aaa8a7,
0x00aa5094,
0x00a9f6c1,
0x00a99b31,
0x00a93de8,
0x00a8dee8,
0x00a87e35,
0x00a81bd0,
0x00a7b7bc,
0x00a751fe,
0x00a6ea98,
0x00a6818c,
0x00a616df,
0x00a5aa93,
0x00a53cab,
0x00a4cd2b,
0x00a45c16,
0x00a3e96f,
0x00a3753a,
0x00a2ff7b,
0x00a28834,
0x00a20f69,
0x00a1951d,
0x00a11955,
0x00a09c14,
0x00a01d5e,
0x009f9d35,
0x009f1b9f,
0x009e989e,
0x009e1437,
0x009d8e6d,
0x009d0745,
0x009c7ec2,
0x009bf4e7,
0x009b69ba,
0x009add3e,
0x009a4f77,
0x0099c069,
0x00993018,
0x00989e89,
0x00980bbf,
0x009777be,
0x0096e28c,
0x00964c2b,
0x0095b4a1,
0x00951bf1,
0x00948220,
0x0093e733,
0x00934b2c,
0x0092ae12,
0x00920fe7,
0x009170b1,
0x0090d075,
0x00902f35,
0x008f8cf7,
0x008ee9c0,
0x008e4593,
0x008da076,
0x008cfa6d,
0x008c537b,
0x008baba7,
0x008b02f3,
0x008a5966,
0x0089af03,
0x008903cf,
0x008857cf,
0x0087ab07,
0x0086fd7c,
0x00864f32,
0x0085a02e,
0x0084f075,
0x0084400a,
0x00838ef4,
0x0082dd36,
0x00822ad6,
0x008177d6,
0x0080c43e,
0x00801010,
0x007f5b52,
0x007ea608,
0x007df036,
0x007d39e2,
0x007c8311,
0x007bcbc6,
0x007b1406,
0x007a5bd6,
0x0079a33a,
0x0078ea38,
0x007830d3,
0x00777710,
0x0076bcf4,
0x00760284,
0x007547c3,
0x00748cb7,
0x0073d163,
0x007315cd,
0x007259f9,
0x00719deb,
0x0070e1a7,
0x00702534,
0x006f6893,
0x006eabcb,
0x006deee0,
0x006d31d5,
0x006c74af,
0x006bb773,
0x006afa25,
0x006a3cc9,
0x00697f64,
0x0068c1f9,
0x0068048d,
0x00674725,
0x006689c4,
0x0065cc6e,
0x00650f28,
0x006451f6,
0x006394dc,
0x0062d7de,
0x00621b00,
0x00615e46,
0x0060a1b4,
0x005fe54d,
0x005f2917,
0x005e6d15,
0x005db14a,
0x005cf5bb,
0x005c3a6b,
0x005b7f5f,
0x005ac499,
0x005a0a1e,
0x00594ff1,
0x00589617,
0x0057dc91,
0x00572365,
0x00566a96,
0x0055b227,
0x0054fa1c,
0x00544278,
0x00538b3f,
0x0052d474,
0x00521e1a,
0x00516835,
0x0050b2c8,
0x004ffdd6,
0x004f4962,
0x004e9570,
0x004de203,
0x004d2f1e,
0x004c7cc3,
0x004bcaf7,
0x004b19bb,
0x004a6913,
0x0049b902,
0x0049098b,
0x00485ab0,
0x0047ac74,
0x0046feda,
0x004651e5,
0x0045a596,
0x0044f9f2,
0x00444efb,
0x0043a4b2,
0x0042fb1b,
0x00425238,
0x0041aa0c,
0x00410298,
0x00405bdf,
0x003fb5e4,
0x003f10a9,
0x003e6c2f,
0x003dc87a,
0x003d258a,
0x003c8363,
0x003be207,
0x003b4176,
0x003aa1b4,
0x003a02c3,
0x003964a3,
0x0038c757,
0x00382ae1,
0x00378f42,
0x0036f47d,
0x00365a92,
0x0035c184,
0x00352954,
0x00349204,
0x0033fb94,
0x00336607,
0x0032d15f,
0x00323d9b,
0x0031aabe,
0x003118c9,
0x003087be,
0x002ff79d,
0x002f6867,
0x002eda1e,
0x002e4cc3,
0x002dc057,
0x002d34db,
0x002caa50,
0x002c20b6,
0x002b980f,
0x002b105b,
0x002a899c,
0x002a03d2,
0x00297efe,
0x0028fb20,
0x00287839,
0x0027f64b,
0x00277554,
0x0026f556,
0x00267652,
0x0025f847,
0x00257b37,
0x0024ff22,
0x00248407,
0x002409e8,
0x002390c4,
0x0023189c,
0x0022a170,
0x00222b40,
0x0021b60c,
0x002141d5,
0x0020ce9a,
0x00205c5c,
0x001feb1b,
0x001f7ad5,
0x001f0b8c,
0x001e9d40,
0x001e2fef,
0x001dc39b,
0x001d5842,
0x001cede4,
0x001c8482,
0x001c1c1b,
0x001bb4af,
0x001b4e3c,
0x001ae8c4,
0x001a8445,
0x001a20bf,
0x0019be31,
0x00195c9c,
0x0018fbfe,
0x00189c56,
0x00183da5,
0x0017dfea,
0x00178324,
0x00172752,
0x0016cc74,
0x00167289,
0x00161990,
0x0015c188,
0x00156a71,
0x00151449,
0x0014bf11,
0x00146ac7,
0x0014176a,
0x0013c4f9,
0x00137373,
0x001322d8,
0x0012d326,
0x0012845c,
0x0012367a,
0x0011e97e,
0x00119d67,
0x00115234,
0x001107e5,
0x0010be77,
0x001075ea,
0x00102e3d,
0x000fe76e,
0x000fa17c,
0x000f5c66,
0x000f182b,
0x000ed4c9,
0x000e9240,
0x000e508e,
0x000e0fb1,
0x000dcfa9,
0x000d9074,
0x000d5211,
0x000d147e,
0x000cd7ba,
0x000c9bc4,
0x000c609a,
0x000c263b,
0x000beca5,
0x000bb3d7,
0x000b7bd1,
0x000b448f,
0x000b0e11,
0x000ad855,
0x000aa35a,
0x000a6f1f,
0x000a3ba1,
0x000a08e0,
0x0009d6da,
0x0009a58d,
0x000974f7,
0x00094518,
0x000915ee,
0x0008e778,
0x0008b9b3,
0x00088c9e,
0x00086037,
0x0008347e,
0x00080971,
0x0007df0d,
0x0007b552,
0x00078c3d,
0x000763ce,
0x00073c03,
0x000714d9,
0x0006ee50,
0x0006c866,
0x0006a31a,
0x00067e69,
0x00065a53,
0x000636d5,
0x000613ee,
0x0005f19c,
0x0005cfdf,
0x0005aeb4,
0x00058e19,
0x00056e0e,
0x00054e90,
0x00052f9e,
0x00051137,
0x0004f358,
0x0004d601,
0x0004b92f,
0x00049ce2,
0x00048117,
0x000465cd,
0x00044b03,
0x000430b7,
0x000416e7,
0x0003fd92,
0x0003e4b6,
0x0003cc52,
0x0003b465,
0x00039cec,
0x000385e6,
0x00036f52,
0x0003592e,
0x0003437a,
0x00032e32,
0x00031956,
0x000304e5,
0x0002f0dc,
0x0002dd3b,
0x0002ca00,
0x0002b729,
0x0002a4b5,
0x000292a3,
0x000280f2,
0x00026f9f,
0x00025ea9,
0x00024e10,
0x00023dd1,
0x00022deb,
0x00021e5e,
0x00020f27,
0x00020045,
0x0001f1b7,
0x0001e37c,
0x0001d592,
0x0001c7f8,
0x0001baac,
0x0001adae,
0x0001a0fc,
0x00019495,
0x00018877,
0x00017ca2,
0x00017114,
0x000165cc,
0x00015ac8,
0x00015008,
0x0001458a,
0x00013b4d,
0x00013150,
0x00012792,
0x00011e12,
0x000114ce,
0x00010bc6,
0x000102f8,
0x0000fa63,
0x0000f206,
0x0000e9e1,
0x0000e1f1,
0x0000da36,
0x0000d2b0,
0x0000cb5c,
0x0000c43a,
0x0000bd49,
0x0000b688,
0x0000aff6,
0x0000a992,
0x0000a35b,
0x00009d50,
0x00009771,
0x000091bc,
0x00008c30,
0x000086cd,
0x00008191,
0x00007c7c,
0x0000778e,
0x000072c4,
0x00006e1f,
0x0000699e,
0x0000653f,
0x00006102,
0x00005ce7,
0x000058ec,
0x00005510,
0x00005154,
0x00004db6,
0x00004a36,
0x000046d3,
0x0000438c,
0x00004061,
0x00003d51,
0x00003a5b,
0x0000377f,
0x000034bc,
0x00003212,
0x00002f80,
0x00002d06,
0x00002aa2,
0x00002855,
0x0000261d,
0x000023fb,
0x000021ee,
0x00001ff6,
0x00001e11,
0x00001c40,
0x00001a82,
0x000018d7,
0x0000173e,
0x000015b7,
0x00001441,
0x000012dc,
0x00001189,
0x00001045,
0x00000f12,
0x00000def,
0x00000cdb,
0x00000bd7,
0x00000ae1,
0x000009fa,
0x00000922,
0x00000858,
0x0000079c,
0x000006ed,
0x0000064d,
0x000005ba,
0x00000534,
0x000004bb,
0x00000450,
0x000003f1,
0x0000039f,
0x0000035a,
0x00000322,
0x000002f6,
0x000002d7,
0x000002c4,
0x000002be
};

const __s16 Data_Sin_1k[] = {
0x0000,0x0000,0x10b4,0x10b4,0x2120,0x2120,0x30fb,0x30fb,
0x3fff,0x3fff,0x4deb,0x4deb,0x5a81,0x5a81,0x658b,0x658b,
0x6ed9,0x6ed9,0x7640,0x7640,0x7ba2,0x7ba2,0x7ee6,0x7ee6,
0x7fff,0x7fff,0x7ee6,0x7ee6,0x7ba2,0x7ba2,0x7640,0x7640,
0x6ed9,0x6ed9,0x658b,0x658b,0x5a81,0x5a81,0x4deb,0x4deb,
0x3fff,0x3fff,0x30fb,0x30fb,0x2120,0x2120,0x10b4,0x10b4,
0x0000,0x0000,0xef4b,0xef4b,0xdedf,0xdedf,0xcf04,0xcf04,
0xc000,0xc000,0xb214,0xb214,0xa57e,0xa57e,0x9a74,0x9a74,
0x9126,0x9126,0x89bf,0x89bf,0x845d,0x845d,0x8119,0x8119,
0x8001,0x8001,0x8119,0x8119,0x845d,0x845d,0x89bf,0x89bf,
0x9126,0x9126,0x9a74,0x9a74,0xa57e,0xa57e,0xb214,0xb214,
0xc000,0xc000,0xcf04,0xcf04,0xdedf,0xdedf,0xef4b,0xef4b,
};
